import { JSEncrypt } from './jsencrypt.js'
 
// 加密公钥
const key = `MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCWnvz3gREFJtAsS++y4a2Z+rv71AyQAF1o2S1afYCa9Ga5bgHyrraIKox/1IZTS4sbzphobal+PhP6B3ldzMeJLdP7alp0ZqfwcP1krvsevTyZ+zH1SXWvMwl2WevPUMuhs2YcXZoFn8qX6GDUOp/eig5Sy0sWAiERpWzqMZ7D3wIDAQAB`
 
// 加密
export function rsaEncrypt (msg) {
  const jsencrypt = new JSEncrypt()
  jsencrypt.setPublicKey(key)
  const encryptMsg = jsencrypt.encryptLong(msg)
  return encryptMsg
}
 
// 解密私钥
const privateKey = `MIICdgIBADANBgkqhkiG9w0BAQEFAASCAmAwggJcAgEAAoGBAKBPT7CDGzsW6+NZSkm2UHZIiJuLS1QZHzc8H4Le7oAWeqOr1BVxgqtTx7/rgxtziFNMtfoVTzZ2WwIQpV7aJuq1BEM/OfaNdYupyK3zTgv+DIDb3hCcT33AHR83EimT92gieghCYf3dcap0AwPqJMImhukSjwiBrBHb6fBz9Xf7AgMBAAECgYEAkDPHsze8HwMXXYLMWFIvPrcwavp54ERY2A61KbvvPjj6SJAgTsm0iPjsDa+EWAUs9AFlEHhqsMr2Qn1GxHPn3Hnh2t59HO7b/917Fi6edBeCeAdZAPjL+KneG55kDOID93v+EpJ7Z73tGIDGKaIg8TGoRjMFtSmFiAdbESmMn4ECQQDjbKHet2LbaUVWnxCfMtPrOoVYy1uSqV9ltMMphQ2BxDcM4SNcwmGJN6XysH+e6uKLCp3zbJo5aAIfCJ5pid0TAkEAtHPcti3mf6uz44ea/lj5p4OlPo+hnDIvNiTwne6/+8EQW/3JIx9OQx0NGGDRunPo6AvgAOTEKcl918FtQcVeeQJAUdnQLFsuPi+WIAXhsppVgSyvv3R5QcCpr+4t62ySnuiis4T3+DORbRRVKpJxbB23aTlp/alRnGWdldPBR9SxdwJAOamkZ5q3QyjM7PISNyCbdkn87cbb75uhtn2LXgxC0OHapmqscUq5qXyJCLc3jYsoa64PwHlZrbizO9SVYyT8kQJAMLDXZbNlE1rKEqP7C0ujwszFcoisIOgdH24q24Ipz2jQZG1Zdv7cIJMEfCeiUz2qBkPt8Lfv3dYZa4Bhi2qYsQ==`

 // const privateKey = ``
// 解密
export function rsaDecrypt (msg) {
  const decrypt = new JSEncrypt()
  decrypt.setPrivateKey(privateKey)
  const decryptMsg = decrypt.decryptLong(msg)
  return decryptMsg
}
